<template>
  <div class="home">
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="date" label="日期" width="180"> </el-table-column>
      <el-table-column prop="name" label="姓名" width="180"> </el-table-column>
      <el-table-column prop="address" label="地址"> </el-table-column>
    </el-table>
  </div>
</template>

<script>
import {getList} from '@/api/inex.js';
// @ is an alias to /src
import HelloWorld from "@/components/HelloWorld.vue";

export default {
  name: "Home",
  components: {
    HelloWorld,
  },
  data () {
    return {
      tableData:[],
    }
  },
  methods: {
    getList(){
      getList({}).then((res)=>{
        let {
            data: { newsList },
        } = res;
        this.tableData = newsList;
      })
    }
  },
  created () {
    this.getList();
  }
};
</script>
